package com.store.orm.config;

import java.util.Objects;

/**
 * 连接池对象
 * max: 最大数
 * init: 初始化的数量
 *
 * @author 宫静雨
 * @version 1.0
 */
public class Pool {
    private Integer init;
    private Integer max;

    public Pool() {
    }

    public Pool(Integer init, Integer max) {
        this.init = init;
        this.max = max;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Pool pool = (Pool) o;
        return Objects.equals(init, pool.init) &&
                Objects.equals(max, pool.max);
    }

    @Override
    public int hashCode() {
        return Objects.hash(init, max);
    }

    public Integer getInit() {
        return init;
    }

    public void setInit(Integer init) {
        this.init = init;
    }

    public Integer getMax() {
        return max;
    }

    public void setMax(Integer max) {
        this.max = max;
    }

    @Override
    public String toString() {
        return "Pool{" +
                "init=" + init +
                ", max=" + max +
                '}';
    }
}